<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
//打印所有的sql语句
Event::listen('illuminate.query',function($query){
	// var_dump($query);
});



Route::get('/', function () {
    return view('home.index');
});

/**
 * 前台路由组
 */

Route::get('/home','HomeController@shouye');


Route::group([],function(){
	
	Route::get('/admin/login','CommonController@login');
	Route::post('/admin/dologin','CommonController@dologin');
	
});

//用户注册
Route::get('/register','HomeController@register');
Route::post('/doregister','HomeController@doregister');

//用户登录
Route::get('/login','HomeController@login');
Route::post('/dologin','HomeController@dologin');

//用户退出
Route::get('/logout','HomeController@logout');

//用户找回
Route::get('/forget','HomeController@forget');
Route::post('/forget','HomeController@doforget');


//重置密码
Route::get('/reset','HomeController@reset');
Route::post('/reset','HomeController@doreset');

//邮箱激活
Route::get('/jihuo','HomeController@jihuo');


//重置密码
Route::get('/reset','HomeController@reset');
Route::post('/reset','HomeController@doreset');



// 交流页面
Route::get('/homes/question','HomeController@question');
// 话题页面
Route::get('/homes/topic','HomeController@topic');

//邮箱激活
Route::get('/jihuo','HomeController@jihuo');


// 提交回复
Route::post('/huifu',function(){
	dd($request->all());
});
// 话题页面
Route::get('/homes/topic','HomeController@topic');

//阅读页面
Route::get('/homes/artical','ArticalController@artical');
//发布文章
Route::get('/homes/publish','ArticalController@publish');
Route::post('/homes/publish','ArticalController@dopublish');
//文章详情
Route::get('/homes/Adetail','ArticalController@Adetail');


// 个人中心
Route::get('/homes/center','UserController@center');
// 个人中心资料编辑
Route::get('/homes/edit','UserController@centeredit');
Route::post('/homes/update','UserController@centerupdate');

//阅读(小书城)
Route::get('/homes/store','StoreController@show');


//使用前台功能需要登录
// 
	// 交流页面
	Route::get('/homes/question','HomeController@question');
	// 话题页面
	Route::get('/homes/topic','HomeController@topic');

	// 个人中心
	Route::get('/homes/center','UserController@center');
	//个人帖子列表
	Route::get('/card/index','CardController@ad');


//会员详情页
Route::get('/home/detail','VipController@detail');
//购买会员
Route::get('/home/order','VipController@order');
//支付页
Route::post('/home/pay','VipController@pay');
//确认支付
Route::post('/home/finish','VipController@finish');

//发帖页面
Route::get('/homes/card','HomeController@card');
Route::post('/homes/card','HomeController@docard');


/**
 * 后台路由组
 */
//如果需要进行登录验证的时候,把该路由规则放入路由组即可
// Route::group(['middleware'=>'login'],function(){

	Route::get('/admin',function(){
		return view('admin');
	});

	Route::get('/home',function(){
		return view('index');
	});


//用户管理
Route::controller('user','UserController');

// 个人中心

// 个人中心资料编辑

Route::post('/homes/update','UserController@centerupdate');

//板块分类管理
Route::controller('cate','CateController');
Route::controller('session','Session1Controller');

//贴子管理
Route::controller('card','CardController');

//阅读(小书城)
Route::controller('store','StoreController');

// 回复管理
Route::controller('reply','ReplyController');
Route::controller('question','QuestionController');
 
// 批量删除  (未实现)

Route::get('/deletes','ReplyController@Deletes');

//导航管理  
Route::controller('nav','NavController');

//文章管理
Route::controller('artical','ArticalController');

//超级用户管理
Route::controller('vip','VipController');
   
  // });

